<template>
  <div>
    他是孙子
    <p>{{Bmoney}}</p>
    <button @click="changeMoney(10)">孙子想花钱了</button>
  </div>
</template>

<script>
import { inject } from 'vue'
export default {
 setup () {
  const Bmoney= inject('money')
  const changeMoney = inject('changeMoney')

  return {
    Bmoney,
    changeMoney
  }
 }
}
</script>

<style>

</style>
